var homeLive=function(){function m(){$.ajax({url:"//www.google.com/events/io/2011/feeds/io-2011-announcements.js",dataType:"script"})}function n(){$.ajax({url:"//www.google.com/events/io/2011/feeds/io-2011-photos.js",dataType:"script"})}function k(a,b){"undefined"==typeof b&&(b=0);var e=[],c=a.slice(b,b+7);$(c).each(function(a,b){var c="photo";0==a&&(c+=" large");0!==a&&0===a%3&&(c+=" last");e.push('<div class="'+c+'" style="background: transparent url('+(0===a?b.image250:b.image100)+
  ') no-repeat 50% 50%"><a href="../index-live_files/'+b.link+'" target="_blank"> </a></div>')});$("#photo-area").html($(e.join("\n")));if(!h){for(var c=[],d=0;d<a.length;d++)0===d%7&&c.push('<a href="" rel="page-'+d+'" class="'+(0===d?"active":"")+'"> </a>');$("#photo-paging").html($(c.join(" ")));h=a;$("#photo-paging a").unbind();$("#photo-paging a").bind("click",function(a){$("#photo-paging a").removeClass("active");$(a.target).addClass("active");a=parseInt($(a.target).attr("rel").split("-")[1],10);k(h,a);
  return!1});f()}}function o(){$.ajax({url:"//www.google.com/events/io/2011/static/js/sessions.json",success:function(a){for(var b=[],e=a.tracks["all-tracks"].sessions,c=0;c<e.length;c++)a.sessions[e[c]].homepage_featured&&a.sessions[e[c]].youtube_url&&b.push(a.sessions[e[c]]);l(b,0)}})}function l(a,b){"undefined"==typeof b&&(b=0);var e=[],c=a.slice(b,b+4);$(c).each(function(a,c){var b="session",d="175",f="100",g="small";0==a&&(b+=" large",d="560",f="315",g="large");1==a&&(b+=" clear");0!==a&&0===a%
    3&&(b+=" last");e.push('<div class="'+b+'"><a href="/events/io/2011/sessions/'+c.slug+'.html" class="overlay"><img src="../index-live_files/'+c.posterframe[g]+'" width="'+d+'" height="'+f+'"></a>'+('<div class="session-info"><h5>'+c.start+'</h5> <h4><a href="/events/io/2011/sessions/'+c.slug+'.html">'+c.title+"</a></h4></div>")+"</div>")});$("#session-area").html($(e.join("\n")));if(!i){for(var c=[],d=0;d<a.length;d++)0===d%4&&c.push('<a href="" rel="page-'+d+'" class="'+(0===d?"active":"")+'"> </a>');$("#session-paging").html($(c.join(" ")));
    i=a;$("#session-paging a").bind("click",function(a){$("#session-paging a").removeClass("active");$(a.target).addClass("active");a=parseInt($(a.target).attr("rel").split("-")[1],10);l(i,a);return!1});f()}}function p(a){var b=$("#"+a+" div.arrow-nav a.up"),e=$("#"+a+" div.arrow-nav a.down");b.bind("click",function(){$("#"+a+" div.arrow-nav a").removeClass("up-inactive down-inactive");$("#"+a+" div.content").animate({scrollTop:"-=200px"},function(){0==$(this).get(0).scrollTop&&b.addClass("up-inactive")});
      return!1});e.bind("click",function(){$("#"+a+" div.arrow-nav a").removeClass("up-inactive down-inactive");$("#"+a+" div.content").animate({scrollTop:"+=200px"},function(){$(this).get(0).scrollTop==$(this).get(0).scrollHeight-$(this).height()&&e.addClass("down-inactive")});return!1})}function f(){g++;g<j.length?j[g].call():(g=-1,setTimeout(function(){h=null;f()},18E4))}var h,i,j,g;return{init:function(){j=[o,m,n];g=-1;f();p("announcements");$("#stream-nav a").each(function(a,b){$(b).click(function(b){$("#stream-nav a").removeClass("active");
      $(b.target).addClass("active");toggleLiveStream(a);return!1})})},showAnnouncements:function(a){var b=[];$(a).each(function(a,c){b.push('<div class="announcement"><h4>'+c.headline+"</h4><p>"+c.summary+'</p><p class="date">'+c.date+"</p></div>")});$("#announcements div.content").html($(b.join("\n")));f()},showPhotos:k}}();
